package character.action;

import com.jme3.math.Vector3f;
import gameobject.construct.Construct;
import character.AbstractCharacter;
import mygame.MyCharacterControl;
import mygame.VoxelGrid;

public abstract class ActionUtility {

    public static float getDistCharToConstruct(AbstractCharacter character, Construct construct) {
	Vector3f distanceToTarget = VoxelGrid.getWorldLocation(construct.getBaseVoxelGridLocation());
	distanceToTarget.subtractLocal(character.getControl(MyCharacterControl.class).getFeetWorldTranslation());
	distanceToTarget.setY(0f);
	return distanceToTarget.length();
    }
}
